#ifndef LUCNX_SYSCALL_H
#define LUCNX_SYSCALL_H

#include <Lucnx/system.h>

enum // 系统调用子功能号枚举
{
    SYS_NR_TEST,
    SYS_NR_WRITE,
    SYS_NR_CLEAR,
    SYS_NR_READ,
    SYS_NR_GETPID,
    SYS_NR_SLEEP,
    SYS_NR_EXIT,
    SYS_NR_SYSINFO,
    SYS_NR_BRK,
    SYS_NR_FORK,
    SYS_NR_GETPPID
};

// 标准文件描述符
typedef enum std_fd_t
{
    stdout,
    stdin
}std_fd_t;

size_t write(fd_t fd, char *buf, int nr);
size_t read(fd_t fd, char *buf, int nr);
void putchar(char ch);
void clear();

void sleep(u32 ms);
void exit();
pid_t getpid();
pid_t getppid();
pid_t fork();

int brk(void *brk);

size_t sysinfo(int nr, void *buf);

void syscall_init();

#endif